// File Name: rs485_interrupt.c
// Author: kukukukuku~
// Date: 2024-12-20

#include "apm32f00x_usart.h"
#include "./RS485/inc/rs485_var.h"

void RS485_USART_RX_IRQ_HANDLE(void)
{
    if(USART_ReadIntFlag(RS485_USART, USART_INT_FLAG_IDLE))
    {
        rs485_int_idle_callback(&rs485Obj);
        
        rs485_usart_receive_data();
    }
    
    if(USART_ReadIntFlag(RS485_USART, USART_INT_FLAG_RX))
    {
        rs485_int_rx_callback(&rs485Obj);
        
        USART_ClearIntFlag(RS485_USART, USART_INT_FLAG_RX);
    }
}
